﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Categories.aspx.cs" Inherits="TicketsOnline.Categories" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
<title>Categories</title>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<div style="float:left;width:200px;border:solid 0px black;">
    <asp:Repeater runat="server" ID="RepeaterCategories">
        <HeaderTemplate>
        <div class="mymenu">
            <h3>Available categories:</h3>
            <ul>
            <li><a href="Categories.aspx">All</a> </li>
        </HeaderTemplate>
        
        <ItemTemplate>
        <li><a href="Categories.aspx?category=<%# Eval("CategoryID") %>"><%# Eval("CategoryName") %></a></li>
        </ItemTemplate>

        <FooterTemplate>
            </ul></div>
        </FooterTemplate>

    </asp:Repeater>
</div>

<div class="ticketsContainer">
    <asp:ScriptManager ID="scriptManager" runat="server"> </asp:ScriptManager>
    <asp:UpdatePanel ID="UpdatePanelTickets" runat="server">
   
        <ContentTemplate>
            <h1> Upcoming events </h1>
             <asp:ListView ID="ListViewTickets" runat="server">
                 <ItemTemplate>
                 <div>
                    <h3 class="eventTitle"><%# Eval("Title") %></h3>
                    <span class="catValue">Category:</span>  <%#Eval("Category.CategoryName") %>  <br />
                    <span class="catValue">Date:</span>  <%#Eval("Date").ToString().Split(' ')[0] %>  <br />
                    <span class="catValue">Price:</span>   $ <%# Eval("Price").ToString().Substring(0,Eval("Price").ToString().IndexOf('.')) %>  <br />
                    <a class="buyTicketsLink" href="<%# "BuyTicket.aspx?event="+Eval("EventID") %>">Buy Tickets</a>
                 </div>
                 </ItemTemplate>
             </asp:ListView>
                 <div id="pagerDiv">
                    <asp:DataPager ID="DataPagerTickets" runat="server" PageSize="5" PagedControlID="ListViewTickets">
                        <Fields>
                            <asp:numericpagerfield ButtonCount="10" NextPageText=">>" 
                                PreviousPageText="<<"  />
                            <asp:nextpreviouspagerfield FirstPageText="First" LastPageText="Last" 
                                NextPageText="Next" PreviousPageText="Previous" />
                        </Fields>
                 
                    </asp:DataPager>
                </div>
        </ContentTemplate>
    </asp:UpdatePanel>
</div>
<div style="clear:both;">

</div>
</asp:Content>
